import React from 'react';

const Test4: React.FC = () => {
  let count = 0; //普通的JS变量无法触发组件的更新
  const add = () => {
    count++;
    console.log('count', count);
  };
  return (
    <>
      <div>
        <button onClick={add}>add:{count}</button>
      </div>
    </>
  );
};
export default Test4;
